package message

import (
	"gomonitor-server/src/mylog"
	"gomonitor-server/src/tcp/types"
	"net"
)

func MessageProcess(messageHandler *MessageHandler, msgType byte, msgData []byte, conn net.Conn) {
	if msgType == types.MSG_TYPE_CONNECT {
		HelloMessage(messageHandler, msgData, conn)
	} else if msgType == types.MSG_TYPE_PING {
		PingMessage(messageHandler, msgData, conn)
	} else if msgType == types.MSG_TYPE_INFO {
		MonitorInfoMessage(messageHandler, msgData, conn)
	} else {
		mylog.Logger.Error("数据类型未定义丢弃数据....")
	}
}
